1. Field of the Invention
The present invention relates to an image processing apparatus, which has a function to extract a desired region of an image.
2. Description of the Related Arts
As an image processing technique by use of a computer, there are various types of region extracting techniques to extract a specific region of an image, with a purpose to perform an image process such as a color changing process, a copying process, a moving process, a transforming process, a rotating process and so on.
Some of these region extracting techniques are adapted to automatically perform such an image process by means of a software, in which a binary coding process is executed to assigning "1" to a region to be extracted, while assign "0" to other regions, on the basis of a characteristic information or a statistical information, such as gray level, chromaticity positional information or differential value of the image, for example.
However, in this kind of region extracting technique, since statistical information is utilized as a threshold for binary coding, there is a problem in that the actual extracted region is inevitably turned to be more or less different from the region intended to be extracted by the operator.
Here, the inventor of the present invention knows that, to overcome the above mentioned problem, a region extracting technique in which the operator is allowed somehow to repetitive set and change the threshold for binary coding until a satisfactory result of region extracting is obtained. Such a region extracting technique will be explained hereinbelow.
In an image processing apparatus by means of such a region extracting technique, at first, data of each picture element of an original image are stored into an image memory, and then, the binary coding process is performed according to a threshold set by an operator. Then, the result is stored into the same image memory or another memory for binary image data. In this manner, after finishing the binary coding process for the entire image, the binary coded data of the result is transferred to a display device, which displays the result of the region extracting process. Accordingly, each time this binary coding process is performed, the data in the image memory or another memory for binary image data are rewritten, with a drawback that the access time with the memory is increased, and thus the image processing speed is considerably lowered.
In Japanese Patent Application Laying Open No. 62-222,370, an image processing technique is disclosed which is intended to overcome this kind of problem as mentioned above. In this reference, the image processing apparatus is provided with an image memory for storing data of each picture element of an original image to be processed, and a look up table disposed between the image memory and a display device. When, a threshold is set in this image processing apparatus, the content of the look up table is changed, and the extracted region is immediately displayed on the display device, so as to allow the operator to speedily and visually verify the currently set threshold is a sufficient value or not, on the display. This image processing apparatus will be explained in detail hereinbelow.
Color image data have three color components, i.e. the three components of R (red), G (green), B (blue), the three components of Y (brightness), R-Y, B-Y (color differences), and the three components of brightness, chromaticity and hue, for example.
Accordingly, three image memories are provided in this image processing apparatus in case of color image processing, and further, three look up tables are provided in this case, each being connected between each image memory and the display. Each of the look up tables is adapted to convert the data values of the image element stored in the image memory and transfer the converted data to the display.
Hereinbelow, the manner of setting the threshold in this image processing apparatus, will be explained with respect to the case that the color image data are stored in the form of Y, R-Y, B-Y color components, where a similar discussion is effected with respect to the R, G, B or other three color components. Here, the color image data stored by Y, R-Y, B-Y components are represented by (y, r, b). As thresholds for region extracting process, the thresholds for the Y component are represented by Ty1 and Ty2, the thresholds for the R-Y component are represented by Tr1 and Ty2, the thresholds for the B-Y component are represented by Tb1 and Tb2. The input and output for the look up table of Y component are represented by yi and yo, respectively. The input and output for the look up table of R-Y component are represented by ri and ro, respectively. The input and output for the look up table of B-Y component are represented by bi and bo, respectively.
At this time, in order to display the region which is surrounded by these six thresholds, i.e. the region to be extracted, the look up tables are set as expressed by the following expressions (1) to (6), for example. EQU if yi&lt;Ty1, or Ty2&lt;yi; yo=Ny . . . (1) EQU if Ty1.ltoreq.yi.ltoreq.Ty2; yo=My . . . (2) EQU if ri.ltoreq.Tr1, or Tr2.ltoreq.ri; ro=Nr . . . (3) EQU if Tr1.ltoreq.ri.ltoreq.Tr2; ro=Mr . . . (4) EQU if bi&lt;Tb1, or Tb2&lt;bi; bo=Nb . . . (5) EQU if Tb1.ltoreq.bi.ltoreq.Tb2; bo=Mb . . . (6)
Wherein, Ni (i=y, r, b) represents a color component data indicating that the pertinent region is outside of the region to be extracted according to the currently set thresholds, while Mi (i=y, r, b) represents a color component data indicating that the pertinent region is inside of the region to be extracted according to the currently set thresholds.
By setting the look up tables in this manner, if each of the three components of the image data is between each pair of the thresholds, i.e. if the above mentioned expressions (2), (4) and (6) are simultaneously satisfied, the output of the look up tables (yo, ro, bo) become (My, Mr, Mb). Namely, the color of the region on the display becomes (My, Mr, Mb).
Accordingly, the region displayed by this color corresponds to the region to be extracted according to the currently set threshold, which can be visually and immediately checked by the operator. Here, since this process can be executed only by changing the content of the look up table but not changing the content of the image memory, the processing speed can be made high. For example, the size of the look up table is as little as 256 bytes in case that the input is 8 bits and the output is 8 bits, this makes the total size of the three look up tables as little as 768 bytes. On the other hand, the size of the image memory is, for example, about 768K bytes in case that the size of the image is 512.times.512 and size of one picture element is 24 bits. That is to say, by use of the look up table, only 1 over 1000 of the change of the data content is necessary in order to change the thresholds, as compared with the case of changing the image memory without the look up table.
As described above, the operator can change the six thresholds Ty1, Ty2, Tr1, Tr2, Tb1, Tb2 is a conversational manner, if the desired region to be extracted can not be obtained by the currently set thresholds while visually and immediately checking if the currently set thresholds are sufficient or not.
In general, it is desirable to be able to perform the region extracting process or threshold setting process more easily, in such an image processing apparatus having a function to extract a desired region of an image.
However, in the above described related art appartus, it is difficult for the operator to find out which one of the six thresholds should be changed so as to obtain the desired region to be extracted. Accordingly, the threshold setting process is performed in a trial and error manner, with a drawback being that a wrong threshold is often set by the operator and the easy and speedy process can not be actually realized in this sense.
As one of the methods to correct an erroneous threshold or find out a proper threshold in a relatively speedy manner in such an image processing apparatus, the inventor of the present invention knows an "undo" method. In this "undo" method, the previously set threshold is memorized, and when a new threshold is set and turned out to be a wrong value, this new threshold is canceled and the threshold is returned to the memorized previous value, so as to resume the threshold setting process again on the basis of the previous value. However, since the threshold setting process is simply repeated in this "undo" method, there is no guarantee at all of obtaining a proper threshold in the next trial, resulting in that the speedy and easy setting process can not be still realized.